package com.epam.controller;

import com.epam.Entity.User;
import com.epam.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MemberController {

    @Autowired
    MemberService memberService;

    /**
     * 创建会员
     * @param user
     * @return
     */
    @RequestMapping(value = "createMember", method = RequestMethod.POST)
    @ResponseBody
    public User CreateMember(@RequestBody User user){
        User res = memberService.createMember(user);
        return res;
    }
}
